package com.alks.entity.data.entity;

import com.alibaba.excel.annotation.format.DateTimeFormat;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * <p>
 * 材料配套查询主要信息
 * </p>
 *
 * @author Tan
 * @since 2023-12-19
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("PC_LOT_HEAD")
@ApiModel(value="PcLotHead对象", description="材料配套查询主要信息")
public class PcLotHead implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "指令")
    private String lotNo;

    @ApiModelProperty(value = "型体")
    private String style;

    @ApiModelProperty(value = "颜色")
    private String color;

    private String brand;

    @ApiModelProperty(value = "客户")
    private String custom;

    @ApiModelProperty(value = "订单数量")
    private Float orderQty;

    @ApiModelProperty(value = "预补数量")
    private Float surplusQty;

    @ApiModelProperty(value = "创建人")
    private String userId;

    @ApiModelProperty(value = "建档时间")
    private LocalDateTime sysDate;

    @ApiModelProperty(value = "公司ID")
    private String companyId;

    private String cutDept;

    private String stitchDept;

    private String lastDept;

    @ApiModelProperty("底模号")
    private String moldNo;

    @ApiModelProperty(value = "大底类型")
    private String lastNo;

    @DateTimeFormat("yyyy/MM/dd")
    @ApiModelProperty("客人交期")
    private LocalDateTime deliveryDate;

    @ApiModelProperty("检核标记")
    private String cfmFlag;

    @ApiModelProperty("检核人")
    private String cfmUser;

    @ApiModelProperty("检核时间")
    private LocalDateTime cfmDate;

    private String moveFlag;

    @ApiModelProperty("全套 默认空 Y是√")
    private String processAll;

    @ApiModelProperty("冲裁 默认空 Y是√")
    private String processCut01;

    @ApiModelProperty("工艺 默认空 Y是√")
    private String processCut02;

    @ApiModelProperty("配套 默认空 Y是√")
    private String processCut03;

    @ApiModelProperty("针车 默认空 Y是√")
    private String processStitch;

    @ApiModelProperty("成型 默认空 Y是√")
    private String processLast;

    private String cancelFlag;

    private String cancelUser;

    private LocalDateTime cancelDate;

    @ApiModelProperty("外发 默认空 Y是√")
    private String outFlag;

    @ApiModelProperty("客人货号")
    private String developmentNo;

    private String orderSeq;

    @ApiModelProperty(value = "大底厂商")
    private String soleVendor;

    @ApiModelProperty(value = "下单日期")
    private LocalDateTime orderDate;

    @ApiModelProperty("备注")
    private String lotRemark;

    private String packing;

    private String country;

    @ApiModelProperty(value = "新旧款")
    private String styleType;

    private LocalDateTime mtlReqDate;

    private BigDecimal lotStatus;

    private BigDecimal lSurplusQty;

    private BigDecimal sSurplusQty;

    private String lotFact;

    private String mitc;

    @ApiModelProperty("审核日期")
    private LocalDateTime checkDate;

    private LocalDateTime crdDate;

    private LocalDateTime poddDate;

    private String sizeType;

    private String customNo;

    @ApiModelProperty("合同号")
    private String customPo;

    @ApiModelProperty("生成状态")
    private String generateFlag;

    @ApiModelProperty("生成人")
    private String generateUser;

    @ApiModelProperty("生成时间")
    private LocalDateTime generateDate;

    @ApiModelProperty("中间码")
    private String mSize;

    private String xlLotRemark;

    private String sameLotNo;

    @ApiModelProperty(value = "0待全检,1全检合格,NULL(不需要全检)")
    private BigDecimal finishCheckStatus;

    @ApiModelProperty(value = "大底")
    private String processSole;

    @ApiModelProperty("颜色代码")
    private String colorCode;

    @ApiModelProperty(value = "冲刀号")
    private String cutNo;

    @ApiModelProperty("审核标记")
    private String checkFlag;

    @ApiModelProperty("审核人")
    private String checkUser;

    @ApiModelProperty("主面料 默认空 Y是√")
    private String processUpper;

    @ApiModelProperty(value = "是否需要穿鞋带 Y需要 N不需要")
    private String lacing;

    @ApiModelProperty(value = "变更后交期")
    private LocalDateTime newDeliDate;

    @ApiModelProperty(value = "拆分备注")
    private String splitRemark;

    @ApiModelProperty(value = "合并指令号")
    private String combineLotNo;

    @ApiModelProperty(value = "客户")
    private String orderCustom;

    @ApiModelProperty(value = "出货港口/客人")
    private String shipCustom;

    @ApiModelProperty(value = "季度")
    private String season;

    private LocalDateTime updateTime;

    public Float getTotalQty() {
        float order = (orderQty != null) ? orderQty : 0.0f;
        float surplus = (surplusQty != null) ? surplusQty : 0.0f;
        return order + surplus;
    }

}
